package com.topnav.mc.admin.entity.bean;

import com.baomidou.mybatisplus.annotation.TableField;
import com.topnav.mc.admin.entity.Device;
import com.topnav.mc.admin.entity.GbServer;
import com.topnav.mc.admin.entity.Organization;
import com.topnav.mc.admin.entity.User;
import com.topnav.mc.validator.group.IAdd;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;

@Data
@Accessors(chain = true)
public class DeviceBean extends Device {

    @ApiModelProperty(value="组织机构编号")
    private String orgCode;
    @ApiModelProperty(value="组织机构名称")
    private String orgName;
    @ApiModelProperty(value="组织机构简称")
    private String shortName;
    @ApiModelProperty(value="组织机构路径")
    private String path;

    @ApiModelProperty(value="国标服务器编号")
    private String gbServerCode;
    @ApiModelProperty(value="国标服务器名称")
    private String gbServerName;
    @ApiModelProperty(value="ip")
    private String gbServerHost;
    @ApiModelProperty(value="国标端口")
    private String gbServerPort;
    @ApiModelProperty(value="域id")
    private String gbServerDomain;
    @ApiModelProperty(value="用户")
    private String gbServerUserName;
    @ApiModelProperty(value="密码")
    private String gbServerPasswrd;
    @ApiModelProperty(value="RTSP端口")
    private String gbServerMediaPort;
    @ApiModelProperty(value="接口端口")
    private String gbServerApiPort;

    @ApiModelProperty(value="行政区划代码")
    private String cityId;
    @ApiModelProperty(value="行业编号")
    private String businessId;
    @ApiModelProperty(value="网标识id")
    private String netIdentityId;
    @ApiModelProperty(value="服务器类型id")
    private String centerTypeId;
    @ApiModelProperty(value="设备类型id")
    private String deviceTypeId;

    @ApiModelProperty(value="用户编号")
    private String userCode;
    @ApiModelProperty(value="用户姓名")
    private String userName;


    private Double lng;
    private Double lat;
    //临时，有用
    private boolean tempFlag=false;

/*    private Integer subscriberPosition;
    private Integer subscriberPositionInterval;
    private Integer subscriberCatalog;
    private Integer subscriberAlarm;*/

    private boolean boolSubscriberPosition;
    private boolean boolSubscriberCatalog;
    private boolean boolSubscriberAlarm;

    public boolean getBoolSubscriberPosition(){
        if (this.getSubscriberPosition() != null && this.getSubscriberPosition() > 0){
            return true;
        }
        return false;
    }

    public boolean getBoolSubscriberCatalog(){
        if (this.getSubscriberCatalog() != null && this.getSubscriberCatalog() > 0){
            return true;
        }
        return false;
    }

    public boolean getBoolSubscriberAlarm(){
        if (this.getSubscriberAlarm() != null && this.getSubscriberAlarm() > 0){
            return true;
        }
        return false;
    }

}
